package day10;

public class Polym01 {
    public static void main(String[] args) {                    //多态练习
        Animal dog1 = new Dog();
        Animal cat1 = new Cat();
        dog1.age=3;
        cat1.age=4;
        dog1.color="黑";
        cat1.color="灰";
        Person p1 = new Person("高**",23);
        p1.keepPet(dog1,"骨头");
        p1.keepPet(cat1,"鱼");

        Dog dog2 = (Dog) dog1;
        dog2.lookHome();
    }
}
